package com.app.manage.utils;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.thread.ConcurrencyTester;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;

import java.io.File;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        String localhostPath = "C:\\Users\\86173\\Desktop\\pjs\\my";
        SFTPUtil.lsNowFiles("43.156.104.193",22,"root","123qwe!@#QWE","/home/").forEach(o->{
            System.err.println(JSONUtil.toJsonStr(o));
        });


    }


    private static void testUpdate(String id){
        String url = "http://localhost:8090/updateUser?id="+id;
        HttpUtil.get(url);
    }

    private static void  listTree(){
        String url = "http://127.0.0.1:7000/basic-system-manage/function/treelist";

        String json = "{\n" +
                "    \"functionStatus\": \"1\"\n" +
                "}";

        String jwt = "JWT eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4MWUzNzE4MS0yODFhLTRlYTUtODE3Mi0yZDJkYmIzOWJhMzkiLCJpYXQiOjE3NDgzMTcyNTAsImlzcyI6ImJvY28tc2VjdXJpdHkiLCJzdWIiOiJ7XCJ1dWlkXCI6XCJJVC15dXpjXCIsXCJvcGVyS2V5XCI6XCJwb3J0YWxfb3BlcnVybDpJVC15dXpjXCJ9IiwiZXhwIjoxNzQ4MzE3NTUwfQ.oUr-UgM7-M-o1puCDCqcF9xuJNR1Qz6OsFWVZO9oc6M";
        String res = HttpRequest.post(url)
                .body(json)
                .header("authorization",jwt)
                .execute()
                .body();
        System.err.println(res);
    }

}
